import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
  path: '/oa',
  name: 'oa',
  meta,
  redirect: { name: 'oa-user-list' },
  component: layoutHeaderAside,
  children: [
    {
      path: 'department_list',
      name: 'oa-department-list',
      component: _import('oa/department/list'),
      meta: {
        ...meta,
        title: '部门列表'
      }
    },
    {
      path: 'user_list',
      name: 'oa-user-list',
      component: _import('oa/user/list'),
      meta: {
        ...meta,
        title: '用户列表'
      }
    },
    {
      path: 'role_list',
      name: 'oa-role-list',
      component: _import('oa/role/list'),
      meta: {
        ...meta,
        title: '角色列表'
      }
    },
    {
      path: 'rights_list',
      name: 'oa-rights-list',
      component: _import('oa/rights/list'),
      meta: {
        ...meta,
        title: '权限列表'
      }
    }
  ]
}
